<%@ page import="java.util.*" %>
<!-- Une JSP qui affiche un mot de passe -->
<%@ page session="false"%>
<%@ page import="Jt.*" %>
<%@ page import="Jt.examples.*" %>
<html><head>
<title> Exemple Chat </title>
<body>
<%  
     String destinataire = request.getParameter("destinataire");
	 String mess = request.getParameter("mess");
	  
      if (mess !=null)
     {

%>
<!- Create an instance of HelloWorld -->

<%

JtMessenger messenger = new JtMessenger (); 

   JtFactory main = new JtFactory (); // Create the factory class


   // Create helloWorld (HelloWorld class)
 
   HelloWorld helloWorld = (HelloWorld) main.createObject (HelloWorld.JtCLASS_NAME);
   
   helloWorld.setGreetingMessage(mess);
   // Create a Message ("JtHELLO")

   JtMDPMessage msg = new JtMDPMessage (HelloWorld.JtHELLO);
   String reply = (String) messenger.sendMessage (helloWorld, msg);
   //out.println(reply);
%>
 votre message est  : <%=reply%>
<%
     }
     else
     {
%>
     <form name=ident action=http://localhost:8080/JtWebExamples/Chat.jsp method=POST>
     
      Destinataire : 
      <input type ="text" name="destinataire" >
      </p>
       <p>Message :       </p>
       <p>
         <TEXTAREA name="mess" rows=4 cols=40>Valeur par défaut</TEXTAREA>
       </p>
       <p>
         <input type="submit" value="ok">
           </p>
</form>
<% } %>
</body></head></html>
